/**
 * @author [siwi]
 * @email [siwi@siwi.me]
 * @create date 2018-03-10 02:37:24
 * @modify date 2018-03-10 02:37:24
 * @desc [mongodb连接]
*/
const mongodb = require('mongodb')
const ObjectId = mongodb.ObjectId 
class MongoDb {
    constructor(url, dbName) {
        this.url = url
        this.dbName = dbName
        this.ObjectId = ObjectId
    }
    async MongoClient () {
        const MongoClient = mongodb.MongoClient
        const connect = await MongoClient.connect(this.url)
        this.connect = connect
        const mongo= connect.db(this.dbName)
        return mongo
    }
}
module.exports = MongoDb